#include "model/synclistmodel.h"

SyncListModel::SyncListModel(int numItems,QObject *parent)
    : QAbstractListModel(parent),mNumberItems(numItems)
{
}


int SyncListModel::rowCount(const QModelIndex &parent) const
{
     return parent.isValid()?0:mNumberItems;
}

QVariant SyncListModel::data(const QModelIndex &index, int role) const
{
    if (index.isValid() && index.row() < mNumberItems)
        if(role == Qt::DisplayRole)
        {
            if(index.row()%5==0)
            {
                return QString("这是一个特殊的元素啊，就是试试换行好用不哈哈哈哈哈哈，我估计不会自动换行了%1").arg(index.row());
            }
            else{
             return QString("元素%1").arg(index.row());
            }
        }
        return QVariant();

    // FIXME: Implement me!
    return QVariant();
}
